/**
 * Author:yuiop
 * Date:2023/1/17 09:27
 */
package com.devops.admin.util;

import cn.hutool.core.util.StrUtil;
import io.fabric8.certmanager.client.CertManagerClient;
import io.fabric8.certmanager.client.DefaultCertManagerClient;
import io.fabric8.kubernetes.client.Config;
import lombok.extern.slf4j.Slf4j;


@Slf4j
public class CertManagerClientUtil {
    public static CertManagerClient getCertManagerClient(String configContent) {
        Assert.isTrueMvc(StrUtil.isNotBlank(configContent),"configContent不能为空");
        Config config = Config.fromKubeconfig(configContent);
        log.info("#####################################################"+config.getMasterUrl());
        return new DefaultCertManagerClient(config);
    }
}
